/* 基础样式 */
:root {
  /* 浅色主题 */
  --light-background: #ffffff;
  --light-foreground: #0f172a;
  --light-card: #ffffff;
  --light-card-foreground: #0f172a;
  --light-primary: #3b82f6;
  --light-primary-foreground: #ffffff;
  --light-secondary: #f1f5f9;
  --light-secondary-foreground: #0f172a;
  --light-muted: #f1f5f9;
  --light-muted-foreground: #64748b;
  --light-accent: #f1f5f9;
  --light-accent-foreground: #0f172a;
  --light-border: #e2e8f0;
  --light-input: #e2e8f0;
  --light-ring: #3b82f6;

  /* 深色主题 */
  --dark-background: #0f172a;
  --dark-foreground: #f8fafc;
  --dark-card: #1e293b;
  --dark-card-foreground: #f8fafc;
  --dark-primary: #3b82f6;
  --dark-primary-foreground: #f8fafc;
  --dark-secondary: #1e293b;
  --dark-secondary-foreground: #f8fafc;
  --dark-muted: #1e293b;
  --dark-muted-foreground: #94a3b8;
  --dark-accent: #1e293b;
  --dark-accent-foreground: #f8fafc;
  --dark-border: #334155;
  --dark-input: #334155;
  --dark-ring: #3b82f6;

  /* 蓝色主题 */
  --blue-background: #0f172a;
  --blue-foreground: #f8fafc;
  --blue-card: #1e293b;
  --blue-card-foreground: #f8fafc;
  --blue-primary: #60a5fa;
  --blue-primary-foreground: #0f172a;
  --blue-secondary: #1e40af;
  --blue-secondary-foreground: #f8fafc;
  --blue-muted: #1e293b;
  --blue-muted-foreground: #94a3b8;
  --blue-accent: #1e40af;
  --blue-accent-foreground: #f8fafc;
  --blue-border: #334155;
  --blue-input: #334155;
  --blue-ring: #60a5fa;

  /* 绿色主题 */
  --green-background: #052e16;
  --green-foreground: #f8fafc;
  --green-card: #064e3b;
  --green-card-foreground: #f8fafc;
  --green-primary: #10b981;
  --green-primary-foreground: #052e16;
  --green-secondary: #065f46;
  --green-secondary-foreground: #f8fafc;
  --green-muted: #064e3b;
  --green-muted-foreground: #94a3b8;
  --green-accent: #065f46;
  --green-accent-foreground: #f8fafc;
  --green-border: #065f46;
  --green-input: #065f46;
  --green-ring: #10b981;

  /* 紫色主题 */
  --purple-background: #2e1065;
  --purple-foreground: #f8fafc;
  --purple-card: #4c1d95;
  --purple-card-foreground: #f8fafc;
  --purple-primary: #a855f7;
  --purple-primary-foreground: #2e1065;
  --purple-secondary: #5b21b6;
  --purple-secondary-foreground: #f8fafc;
  --purple-muted: #4c1d95;
  --purple-muted-foreground: #94a3b8;
  --purple-accent: #5b21b6;
  --purple-accent-foreground: #f8fafc;
  --purple-border: #5b21b6;
  --purple-input: #5b21b6;
  --purple-ring: #a855f7;

  /* 橙色主题 */
  --orange-background: #7c2d12;
  --orange-foreground: #f8fafc;
  --orange-card: #9a3412;
  --orange-card-foreground: #f8fafc;
  --orange-primary: #f97316;
  --orange-primary-foreground: #7c2d12;
  --orange-secondary: #c2410c;
  --orange-secondary-foreground: #f8fafc;
  --orange-muted: #9a3412;
  --orange-muted-foreground: #94a3b8;
  --orange-accent: #c2410c;
  --orange-accent-foreground: #f8fafc;
  --orange-border: #c2410c;
  --orange-input: #c2410c;
  --orange-ring: #f97316;

  /* 默认使用深色主题 */
  --background: var(--dark-background);
  --foreground: var(--dark-foreground);
  --card: var(--dark-card);
  --card-foreground: var(--dark-card-foreground);
  --primary: var(--dark-primary);
  --primary-foreground: var(--dark-primary-foreground);
  --secondary: var(--dark-secondary);
  --secondary-foreground: var(--dark-secondary-foreground);
  --muted: var(--dark-muted);
  --muted-foreground: var(--dark-muted-foreground);
  --accent: var(--dark-accent);
  --accent-foreground: var(--dark-accent-foreground);
  --border: var(--dark-border);
  --input: var(--dark-input);
  --ring: var(--dark-ring);

  /* 尺寸 */
  --radius: 0.5rem;
  --header-height: 4rem;
  --sidebar-width: 16rem;
  --sidebar-width-collapsed: 4rem;
}

/* 主题类 */
.theme-light {
  --background: var(--light-background);
  --foreground: var(--light-foreground);
  --card: var(--light-card);
  --card-foreground: var(--light-card-foreground);
  --primary: var(--light-primary);
  --primary-foreground: var(--light-primary-foreground);
  --secondary: var(--light-secondary);
  --secondary-foreground: var(--light-secondary-foreground);
  --muted: var(--light-muted);
  --muted-foreground: var(--light-muted-foreground);
  --accent: var(--light-accent);
  --accent-foreground: var(--light-accent-foreground);
  --border: var(--light-border);
  --input: var(--light-input);
  --ring: var(--light-ring);
}

.theme-dark {
  --background: var(--dark-background);
  --foreground: var(--dark-foreground);
  --card: var(--dark-card);
  --card-foreground: var(--dark-card-foreground);
  --primary: var(--dark-primary);
  --primary-foreground: var(--dark-primary-foreground);
  --secondary: var(--dark-secondary);
  --secondary-foreground: var(--dark-secondary-foreground);
  --muted: var(--dark-muted);
  --muted-foreground: var(--dark-muted-foreground);
  --accent: var(--dark-accent);
  --accent-foreground: var(--dark-accent-foreground);
  --border: var(--dark-border);
  --input: var(--dark-input);
  --ring: var(--dark-ring);
}

.theme-blue {
  --background: var(--blue-background);
  --foreground: var(--blue-foreground);
  --card: var(--blue-card);
  --card-foreground: var(--blue-card-foreground);
  --primary: var(--blue-primary);
  --primary-foreground: var(--blue-primary-foreground);
  --secondary: var(--blue-secondary);
  --secondary-foreground: var(--blue-secondary-foreground);
  --muted: var(--blue-muted);
  --muted-foreground: var(--blue-muted-foreground);
  --accent: var(--blue-accent);
  --accent-foreground: var(--blue-accent-foreground);
  --border: var(--blue-border);
  --input: var(--blue-input);
  --ring: var(--blue-ring);
}

.theme-green {
  --background: var(--green-background);
  --foreground: var(--green-foreground);
  --card: var(--green-card);
  --card-foreground: var(--green-card-foreground);
  --primary: var(--green-primary);
  --primary-foreground: var(--green-primary-foreground);
  --secondary: var(--green-secondary);
  --secondary-foreground: var(--green-secondary-foreground);
  --muted: var(--green-muted);
  --muted-foreground: var(--green-muted-foreground);
  --accent: var(--green-accent);
  --accent-foreground: var(--green-accent-foreground);
  --border: var(--green-border);
  --input: var(--green-input);
  --ring: var(--green-ring);
}

.theme-purple {
  --background: var(--purple-background);
  --foreground: var(--purple-foreground);
  --card: var(--purple-card);
  --card-foreground: var(--purple-card-foreground);
  --primary: var(--purple-primary);
  --primary-foreground: var(--purple-primary-foreground);
  --secondary: var(--purple-secondary);
  --secondary-foreground: var(--purple-secondary-foreground);
  --muted: var(--purple-muted);
  --muted-foreground: var(--purple-muted-foreground);
  --accent: var(--purple-accent);
  --accent-foreground: var(--purple-accent-foreground);
  --border: var(--purple-border);
  --input: var(--purple-input);
  --ring: var(--purple-ring);
}

.theme-orange {
  --background: var(--orange-background);
  --foreground: var(--orange-foreground);
  --card: var(--orange-card);
  --card-foreground: var(--orange-card-foreground);
  --primary: var(--orange-primary);
  --primary-foreground: var(--orange-primary-foreground);
  --secondary: var(--orange-secondary);
  --secondary-foreground: var(--orange-secondary-foreground);
  --muted: var(--orange-muted);
  --muted-foreground: var(--orange-muted-foreground);
  --accent: var(--orange-accent);
  --accent-foreground: var(--orange-accent-foreground);
  --border: var(--orange-border);
  --input: var(--orange-input);
  --ring: var(--orange-ring);
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 布局 */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
}

.page-content {
  padding: 1.5rem;
  background-color: var(--card);
  padding-bottom: 8rem;
}

.section {
  margin-bottom: 2rem;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-width-collapsed);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo i {
  font-size: 1.5rem;
}

.sidebar-collapsed .logo-text {
  display: none;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem;
  margin-bottom: 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--foreground);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--secondary);
  transform: translateX(2px);
}

.nav-item.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-item i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-item .badge {
  display: none;
}

.sidebar-section {
  margin-bottom: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}

.section-toggle {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  cursor: pointer;
}

.section-toggle i {
  transition: transform 0.2s ease;
}

.section-collapsed .section-toggle i {
  transform: rotate(-90deg);
}

.section-header h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.sidebar-collapsed .section-header h3 {
  display: none;
}

.sidebar-collapsed .section-toggle {
  margin: 0 auto;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  max-height: 1000px;
  opacity: 1;
}

.section-collapsed .section-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-left: auto;
  background-color: var(--secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  min-width: 1.5rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 源切换按钮 */
.btn-source {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-source:hover {
  background-color: var(--primary);
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-collapsed .btn-source span {
  display: none;
}

.sidebar-collapsed .btn-source {
  justify-content: center;
}

/* 源切换下拉菜单 */
.source-dropdown {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 250px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.source-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.source-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  transition: background-color 0.2s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.source-dropdown-item:hover {
  background-color: var(--secondary);
}

.source-dropdown-item.active {
  border-left-color: var(--primary);
  background-color: var(--secondary);
}

.source-dropdown-item-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.source-dropdown-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: 9999px;
}

.source-dropdown-item-actions {
  display: flex;
  gap: 0.25rem;
}

.source-dropdown-edit,
.source-dropdown-delete {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  color: var(--muted-foreground);
}

.source-dropdown-edit:hover,
.source-dropdown-delete:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.source-dropdown-delete:hover {
  color: #ef4444;
}

.source-dropdown-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--secondary);
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-top: 1px solid var(--border);
}

.source-dropdown-add:hover {
  background-color: var(--accent);
}

.source-dropdown-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--muted-foreground);
  text-align: center;
}

.source-dropdown-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.btn-collapse {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-collapse:hover {
  background-color: var(--accent);
  transform: translateX(2px);
}

.sidebar-collapsed .btn-collapse span {
  display: none;
}

.sidebar-collapsed .btn-collapse {
  justify-content: center;
}

.sidebar-collapsed .btn-collapse i {
  transform: rotate(180deg);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}

.sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }
}

/* 顶部导航栏 */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-direction: row;
}

.menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
}

/* 现代化搜索框 */
.search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: none;
}

.search-form {
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 1rem 0 2.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: var(--foreground);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.search-input:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.btn-search {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}

.btn-close-search {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
  opacity: 0;
}

.search-input:focus + .btn-search + .btn-close-search,
.search-input:not(:placeholder-shown) + .btn-search + .btn-close-search {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--foreground);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--secondary);
  transform: translateY(-1px);
}

/* 页面标题 */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.page-title::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 3rem;
  height: 0.25rem;
  background-color: var(--primary);
  border-radius: 9999px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--primary);
}

/* 媒体卡片网格 */
.media-categories {
  margin-bottom: 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--secondary);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--primary) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.category-card:hover::before {
  opacity: 0.1;
}

.category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--primary-foreground);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-icon i {
  font-size: 1.5rem;
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.media-section {
  margin-bottom: 2.5rem;
  position: relative;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.view-more {
  display: flex;
  align-items: center;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.view-more:hover {
  transform: translateX(2px);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--card);
  padding-right: 10px;
}

.media-grid::-webkit-scrollbar {
  width: 8px;
}

.media-grid::-webkit-scrollbar-track {
  background: var(--card);
  border-radius: 4px;
}

.media-grid::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.media-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  background-color: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.media-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.media-poster {
  position: relative;
  padding-top: 150%; /* 2:3 aspect ratio */
  background-color: var(--muted);
  overflow: hidden;
}

.media-poster img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.media-card:hover .media-poster img {
  transform: scale(1.1);
}

/* 媒体卡片悬停控件 */
.media-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.media-card:hover .media-controls {
  opacity: 1;
}

.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(2px);
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.play-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.media-actions {
  display: flex;
  gap: 0.75rem;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-button:hover {
  background-color: var(--primary);
  transform: translateY(-2px);
}

.action-button.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* 媒体操作菜单 */
.media-action-menu {
  position: absolute;
  width: 200px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 100;
  overflow: hidden;
  display: none;
  animation: menu-in 0.2s ease;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.action-menu-item:hover {
  background-color: var(--secondary);
}

.action-menu-item i {
  font-size: 1rem;
  color: var(--muted-foreground);
}

.media-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-card:hover .media-overlay {
  opacity: 1;
}

.media-title {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.media-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.media-loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.media-skeleton {
  position: relative;
  padding-top: 150%; /* 2:3 aspect ratio */
  background-color: var(--muted);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.media-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 表单元素 */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--secondary);
  color: var(--foreground);
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* 模态对话框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.open .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-body {
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* 源列表 */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.source-item {
  padding: 1rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.source-item.active {
  border-color: var(--primary);
  background-color: var(--primary);
  background-opacity: 0.1;
}

.source-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.source-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.source-item-name {
  font-weight: 600;
}

.source-item-badge {
  padding: 0.25rem 0.5rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
}

.source-item-url {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.source-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.source-item-detail {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.source-item-detail-label {
  width: 3rem;
  color: var(--muted-foreground);
}

.source-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.source-item-action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* 主题选择 */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  cursor: pointer;
}

.theme-option:hover {
  background-color: var(--secondary);
}

.theme-preview {
  width: 100%;
  height: 5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.light-preview {
  background-color: var(--light-background);
  border: 1px solid var(--light-border);
}

.dark-preview {
  background-color: var(--dark-background);
  border: 1px solid var(--dark-border);
}

.blue-preview {
  background-color: var(--blue-background);
  border: 1px solid var(--blue-border);
}

.green-preview {
  background-color: var(--green-background);
  border: 1px solid var(--green-border);
}

.purple-preview {
  background-color: var(--purple-background);
  border: 1px solid var(--purple-border);
}

.orange-preview {
  background-color: var(--orange-background);
  border: 1px solid var(--orange-border);
}

/* 下拉菜单 */
.dropdown {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 10;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border);
  margin: 0.25rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
  cursor: pointer;
  width: 100%;
}

.dropdown-item:hover {
  background-color: var(--secondary);
}

.dropdown-item.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* 筛选和排序 */
.filter-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-sort-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.25rem;
}

.filter-panel {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
  display: none;
  position: absolute;
  z-index: 9;
  width: calc(97% - var(--sidebar-width));
}

.filter-panel.open {
  max-height: 1000px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-group {
  display: flex;
  gap: 1rem;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-group-title {
  font-weight: 500;
}

.filter-group-title.active {
  color: var(--primary);
  font-weight: 600;
}

.filter-group-title.active i {
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-panel-footer {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.total-items {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* 无限滚动 */
.infinite-scroll-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
  gap: 0.5rem;
  color: var(--muted-foreground);
}

.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* 空状态和错误状态 */
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
}

.empty-state i,
.error-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p,
.error-state p {
  margin-bottom: 1.5rem;
}

/* 详情页样式 */
.detail-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 400px;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: -1;
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--background));
}

.detail-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: 300px 1fr;
  }
}

.detail-poster {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
}

.detail-credit-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.detail-credit-label {
  width: 3rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.detail-credit-value {
  color: var(--foreground);
}

.detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.detail-divider {
  height: 1px;
  background-color: var(--border);
  margin: 2rem 0;
}

.detail-plot h2,
.detail-episodes h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-plot p {
  color: var(--muted-foreground);
  line-height: 1.6;
  white-space: pre-line;
}

.episode-source {
  margin-bottom: 2rem;
}

.episode-source h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.episode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  text-align: center;
}

.episode-button:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
  transform: translateY(-2px);
}

/* 播放器页面样式 */
.player-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.player-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.player-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: #fff;
}

.video-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player {
  max-height: 100%;
  max-width: 100%;
  aspect-ratio: 16/9;
}

.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-wrapper:hover .player-controls {
  opacity: 1;
}

.player-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  position: relative;
}

.progress-handle {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

.btn-player {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  transition: all 0.2s ease;
  border: none;
}

.btn-player:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.btn-player:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.episode-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background-color: var(--card);
  z-index: 20;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.episode-sidebar.open {
  transform: translateX(0);
}

.episode-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.episode-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.source-selector {
  margin-bottom: 2rem;
}

.source-selector h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.source-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.source-button {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.source-button:hover {
  background-color: var(--accent);
}

.source-button.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.episode-selector h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.episode-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.episode-sidebar-open .episode-sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

/* 收藏页面样式 */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.favorite-card {
  position: relative;
  border-radius: var(minmax(200px, 1fr));
  gap: 1.5rem;
}

.favorite-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.favorite-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.favorite-poster {
  position: relative;
  padding-top: 150%; /* 2:3 aspect ratio */
  background-color: var(--muted);
  overflow: hidden;
}

.favorite-poster img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.favorite-card:hover .favorite-poster img {
  transform: scale(1.1);
}

.favorite-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.2s ease;
  z-index: 2;
}

.favorite-card:hover .favorite-remove {
  opacity: 1;
}

.favorite-remove:hover {
  background-color: var(--destructive, #ef4444);
}

.favorite-info {
  padding: 0.75rem;
}

.favorite-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.favorite-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.favorite-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* 搜索页面样式 */
.search-header {
  margin-bottom: 1.5rem;
}

.search-info {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Toast 通知 */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 350px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast i {
  font-size: 1.25rem;
}

.toast-success i {
  color: #10b981;
}

.toast-error i {
  color: #ef4444;
}

.toast-info i {
  color: #3b82f6;
}

/* 动画 */
.fade-in {
  animation: fade-in 0.5s ease forwards;
}

.fade-in-up {
  animation: fade-in-up 0.5s ease forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .page-content {
    padding: 1rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 250px;
    margin: 0 auto;
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .filter-sort-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-sort-actions {
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .media-grid,
  .media-loading-grid,
  .infinite-scroll-container {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .favorites-grid,
  .favorite-loading {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
}

/* 工具类 */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 设置按钮 */
.settings-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--primary-foreground);
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.settings-button:hover {
  transform: translateY(-2px) rotate(30deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.settings-button i {
  font-size: 1.25rem;
}

/* 设置页面容器 */
.settings-container {
  margin: 0 auto;
  padding: 2rem;
}

/* 标签页导航 */
.settings-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--muted);
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.settings-tab {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
}

.settings-tab:hover {
  color: var(--foreground);
}

.settings-tab.active {
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 设置面板 */
.settings-panel {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.settings-panel-header {
  margin-bottom: 1.5rem;
}

.settings-panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-panel-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* 表单控件 */
.settings-form-group {
  margin-bottom: 1.5rem;
}

.settings-form-group:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.settings-label-text {
  font-weight: 500;
}

.settings-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* 开关按钮 */
.settings-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--input);
  transition: .4s;
  border-radius: 34px;
}

.settings-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: var(--background);
  transition: .4s;
  border-radius: 50%;
}

.settings-switch input:checked + .settings-switch-slider {
  background-color: var(--primary);
}

.settings-switch input:checked + .settings-switch-slider:before {
  transform: translateX(20px);
}

/* 输入框和选择框 */
.settings-input,
.settings-select {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--input);
  color: var(--foreground);
  transition: all 0.2s ease;
}

.settings-input:focus,
.settings-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.settings-input::placeholder {
  color: var(--muted-foreground);
}

/* 按钮 */
.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.settings-button-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.settings-button-outline {
  border: 1px solid var(--border);
  background-color: transparent;
}

.settings-button-outline:hover {
  background-color: var(--secondary);
}

/* 源设置卡片 */
.settings-source-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.settings-source-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-source-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.settings-source-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.settings-source-actions {
  display: flex;
  gap: 0.5rem;
}

.settings-source-info {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.settings-source-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.settings-source-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-source-stat i {
  color: var(--primary);
}

/* 响应式调整 pc端时 */
@media (min-width: 767px) {
  .sidebar-close-btn {
    display: none;
  }
  .menu-toggle{
    display: none;
  }
  .category-grid{
    gap: 5rem;
  }
  .settings-tabs {
    flex-wrap: wrap;
  }
  
  .settings-tab {
    flex: 1 1 auto;
    text-align: center;
  }
  
  .settings-panel {
    padding: 1.5rem;
  }
  .header{
    flex-direction: row-reverse;
  }
  .media-grid{
    max-height: calc(100vh - 250px);
  }
}

/* 响应式调整 移动端时 */
@media (max-width: 767px) {
  .media-overlay{
    opacity: 1;
  }
  .total-items{
    position: absolute;
    right: 1.25rem;
    top:calc(var(--header-height) + 2rem);
  }
}
